const service = require("../services/shop");

class Controller {
	async list(req, res) {
		res.json(await service.list());
	}

	async add(req, res) {
		res.json(await service.add(req.body));
	}
	async update(req, res) {
		res.json(await service.update(req.body));
	}
	async del(req, res) {
		res.json(await service.del(req.body));
	}

	async addShopType(req, res) {
		res.json(await service.addShopType(req.body));
	}

	async delShopType(req, res) {
		res.json(await service.delShopType(req.body));
	}

	async uploadLogo(req, res) {
		res.json(await service.uploadLogo(req));
	}

	async uploadCover(req, res) {
		res.json(await service.uploadCover(req));
	}

	async getShopByType(req, res) {
		res.json(await service.getShopByType(req.query));
	}

	async getShopById(req, res) {
		res.json(await service.getShopById(req.query));
	}
}

module.exports = new Controller();
